<form id="<?php echo $uniqid;?>" method="post" style="padding: 8px;">
    <table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
        <tr bgcolor="#FFFFFF">
            <td class="tlabel"  width="10%">账号：</td>
            <td width="40%"><input type="text"
                                   class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入电话.." required="true" v-model="params.username"></td>
            <td class="tlabel"  width="10%">密码：</td>
            <td width="40%"><input type="text" class="forminput inputstyle validatebox-text textbox-prompt"
                                   placeholder="无需修改请留空.."  v-model="params.resetPwd"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" >手机号：</td>
            <td><input type="text" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入手机号.."  v-model="params.phone">
            </td>
            <td class="tlabel" >会员积分：</td>
            <td><input type="text" class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                                   placeholder="请输入积分 .."  v-model="params.score">
            </td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" >会员等级：</td>
            <td><input type="text" readonly
            class="forminput inputstyle validatebox-text easyui-validatebox"
            v-model="params.rank.name"></td>
            <td class="tlabel" >过期时间：</td>
            <td><input type="text" readonly
                       class="forminput inputstyle validatebox-text easyui-validatebox easyui-datebox"
                       v-model="params.expired_at"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" >可发布信息条数：</td>
            <td><input type="text" readonly
            class="forminput inputstyle validatebox-text easyui-validatebox"
            v-model="params.own_num"></td>
            <td class="tlabel" >已发布信息条数：</td>
            <td><input type="text" readonly
                       class="forminput inputstyle validatebox-text easyui-validatebox"
                       v-model="params.issued_num"></td>
        </tr>

        <tr bgcolor="#FFFFFF">
            <td class="tlabel" >qq：</td>
            <td><input name="birthday" type="text"
                       class="forminput inputstyle validatebox-text easyui-validatebox"
                       placeholder="请输入qq.." v-model="params.info.qq"></td>
            <td class="tlabel" >邮箱：</td>
            <td><input name="email" type="text"
                       class="forminput inputstyle validatebox-text easyui-validatebox"
                       placeholder="请输入邮箱.." v-model="params.info.email"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td class="tlabel" >状态：</td>
            <td>
                <label><input name="status" type="checkbox" class="textbox-prompt" v-model="params.status">激活</label></td>
            </td>
            <td class="tlabel" >排序：</td>
            <td><input name="sortorder" type="text"
                       class="forminput inputstyle validatebox-text textbox-prompt easyui-validatebox"
                       placeholder="请输入排序.." v-model="params.sortorder"></td>
        </tr>
    </table>
</form>

<script>
    var membersEditVm = new Vue({
        el: '#<?php echo $uniqid;?>',
        data: {
            params: JSON.parse('<?php echo addslashes($dataset);?>'),
        },
        methods: {
            submit: function () {
                membersEditVm.params.status = membersEditVm.params.status ? 1 : 0;
                $.post('/admin/members/edit', membersEditVm.params, function (data) {
                    if (data.ret == 0) {
                        $.messager.show({
                            title: '提示',
                            msg: data.msg,
                            timeout: 3000,
                            showType: 'slide'
                        });
                        $('#<?php echo $uniqid;?>').form('clear');
                        $("#membersdlg").dialog('close');
                        $("#members").datagrid('reload');
                    } else {
                        $.messager.alert('提示', data.msg, 'warning');
                    }
                }, 'json');
            }
        }
    });
    $(function () {
        $('#memberseditsubmit').click(function (data) {
            membersEditVm.submit();
        });
    });
</script>
